<%@page import="FunCtion.Post"%>
<%@page import="java.util.ArrayList"%>
<%@page import="jdbc.DBOPost"%>
<%@page import="FunCtion.Board"%>
<%@page import="jdbc.DBOBoard"%>
<%@page import="jdbc.DBOUser"%>
<%@page import="HumanM.PUser"%>
<%@page import="FunCtion.Topic"%>
<%@page import="jdbc.DBOTopic"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>帖子页面</title>
<style type="text/css">
.main {
	position: relative;
	width: 688px;
	height: 315px;
	border-radius: 10px;
	z-index: 1;
	left: 25px;
	top: 30px;
	background-color: #FFF;
	border: 1px solid #CCC;
}
#photo {
	position: absolute;
	left: 34px;
	top: 36px;
	height: 50px;
	width: 50px;
	border-radius: 50%;
	z-index: 2;
}
#nav {
	position: absolute;
	left: 815px;
	top: 33px;
	width: 356px;
	height: 447px;
	z-index: 2;
	background-color: #FFF;
}
#topic_name {
	position: absolute;
	left: 96px;
	top: 45px;
	width: 572px;
	height: 42px;
	z-index: 3;
}
.main .content {
	position: absolute;
	left: 96px;
	top: 92px;
	width: 572px;
	height: 186px;
	word-wrap: break-word;
	/* overflow:hidden;*/
	float: none;
	visibility: inherit;
}
#main #main_bottom {
	height: 0px;
	width: 688px;
	height: 1px;
	margin-top: -1px;
	clear: both;
	overflow: hidden;
	position: relative;
	border: 1px solid #FFF;
	bottom: 1px;
}
#content {
	left: 96px;
	top: 92px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
	height: 172px;
	width: 572px;
	overflow: auto;
	position: absolute;
}
.boddyy {
	background-color: #F1F2F3;
}
.boddyy #main #topic_name a {
	text-decoration: none;
}
.boddyy #nav ul {
	list-style-type: none;
	float: left;
	margin: 0px;
	padding: 0px;
}
.boddyy #nav ul li a {
	text-decoration: none;
	float: none;
	font-size: 24px;
	margin: 10px;
}
.boddyy #nav ul li .box {
	font-size: 36px;
	margin: 20px;
	font-weight: bold;
	font-family: "黑体";
}
.boddyy #nav ul li {
	margin: 0px;
	float: left;
	padding-top: 30px;
	padding-right: 30px;
	padding-bottom: 30px;
	padding-left: 0px;
}
.boddyy #nav ul li .time {
	font-size: 24px;
}
.boddyy ul {
	list-style-type: none;
	position: absolute;
	margin: 1px;
	padding: 1px;
}
.boddyy ul .replays {
	position: relative;
	width: 688px;
	height: 315px;
	border-radius: 10px;
	z-index: 1;
	left: 25px;
	top: 30px;
	background-color: #FFF;
	border: 1px solid #09F;
	margin: 2px;
	padding: 2px;
	
}
.boddyy ul .replays a{
	text-decoration: none;
	
}
}
.replays .content {
	position: absolute;
	left: 96px;
	top: 92px;
	width: 572px;
	height: 186px;
	word-wrap: break-word;
	/* overflow:hidden;*/
	float: none;
	visibility: inherit;
}

body{
zoom: 1;
transform-origin: 0px 0px;//在使用transform方法进行文字或图像的变形时，是以元素的中心点为基准点进行的。使用transform-origin属性，可以改变变形的基准点,用法：transform-origin: 10px 10px;
transform: scale(0.8, 0.8);//第一个参数:指定水平方向的缩放倍率，第二个参数:指定垂直方向的缩放倍率
overflow:-Scroll;
overflow-x:hidden
}

</style>
</head>

<body class="boddyy">

<%
     int topic_id = Integer.parseInt(request.getParameter("topic_id"));//获得话题的ID号
     DBOTopic dbtp=new DBOTopic();
     DBOUser dbu=new DBOUser();
     DBOBoard dbbo=new DBOBoard();
     DBOPost dbpo=new DBOPost();
     
   //话题信息、该话题用户信息、该话题板块信息、该话题所有帖子信息
     Topic tp=dbtp.some_Topic(topic_id);
     PUser user=dbu.Q_user_info(dbu.Q_user_info_ofid(tp.topic_user_id));
     Board boa=dbbo.Query_isBoard(tp.topic_board_id);
     
     ArrayList<Post> post_list=dbpo.Query_AllPost();//问题1

     
%>

<%
		PUser Current_user=(PUser)session.getAttribute("user");
		if(Current_user!=null)
		{
%>
<div id="main" class="main">

		<div id="photo">
    		<img width="48" height="48"src=	"<%=user.puser_face %>" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
楼主@<%=user.puser_name%> <%=tp.topic_time%> <a href="add_replay_post.jsp?user_id=<%=user.puser_id%>&&Current_user=<%=Current_user.puser_id%>&&topic_id=<%=topic_id%>">评论</a>
   </div> 
   
  <div class="content" id="content">
  <b><%=tp.topic_name%></b>
  <br>
  <br>
 <%=tp.topic_info%>


          
  </div>


</div>


<div id="nav">
  <ul>
  
   	<li><span class="box">板块</span> <a href="#"><%=tp.topic_name %></a> </li>
    <li><span class="box">楼主</span><a href="#"><%=user.puser_name%></a></li>
    <li><span class="box">发布时间</span><span class="time"><%=tp.topic_time%></span></li>  
    <li><a href="add_replay_post.jsp?user_id=<%=user.puser_id%>">发表帖子</a></li> 
    
    </ul>
    
    

</div>

<ul>
<%for(int i=0;i<post_list.size();i++)
{ 
	Post pos=(Post)post_list.get(i);
	if(pos.post_topic_id==tp.topic_id){
   PUser post_user=dbu.Q_user_info(dbu.Q_user_info_ofid(pos.post_user_id));
   Board post_board=dbbo.Query_isBoard(pos.post_board_id);
   Topic post_topic=dbtp.some_Topic(pos.post_topic_id);
   PUser post_replay_user=dbu.Q_user_info(dbu.Q_user_info_ofid(pos.post_reply_id));
%>
  <li>
<div id="replays" class="replays">

		<div id="photo">
    		<img width="48" height="48"src=	"<%=post_user.puser_face %>" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
  @<%=post_user.puser_name %> <%=pos. post_time%> <a href="add_replay_post.jsp">回复</a>
   </div> 
   
  <div class="content" id="content">
  <b><%=post_topic.topic_name%></b>
  <br>
  <br>
 <%=pos.post_content %>
  </div>
</div>
	</li>
  <%}} %>  
     <li>
<div id="replays" class="replays">

		<div id="photo">
    		<img width="48" height="48"src=	"assets/img/photo/photo_11.png" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
 @root 2020-04-27 13:34 <a href="add_replay_post.jsp">回复</a>
  </div> 
   
  <div class="content" id="content">
  <b>测试主题1</b>
  <br>
  <br>
  @root 我回复我自己。
  </div>
</div>
	</li>
</ul>
<%}else{%>
<div id="main" class="main">

		<div id="photo">
    		<img width="48" height="48"src=	"<%=user.puser_face %>" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
楼主@<%=user.puser_name%> <%=tp.topic_time%> <a href="Front-end/user/user_info_check.jsp">评论</a>
   </div> 
   
  <div class="content" id="content">
  <b><%=tp.topic_name%></b>
  <br>
  <br>
 <%=tp.topic_info%>


          
  </div>


</div>


<div id="nav">
  <ul >
   	<li><span class="box">板块</span> <a href="#"><%=tp.topic_name %></a> </li>
    <li><span class="box">楼主</span><a href="#"><%=user.puser_name%></a></li>
    <li><span class="box">发布时间</span><span class="time"><%=tp.topic_time%></span></li>  
    <li><a href="Front-end/user/user_info_check.jsp">发表帖子</a></li> 
    </ul>
    
    

</div>

<ul>
<%for(int i=0;i<post_list.size();i++)
{ 
	Post pos=(Post)post_list.get(i);
	if(pos.post_topic_id==tp.topic_id){
   PUser post_user=dbu.Q_user_info(dbu.Q_user_info_ofid(pos.post_user_id));
   Board post_board=dbbo.Query_isBoard(pos.post_board_id);
   Topic post_topic=dbtp.some_Topic(pos.post_topic_id);
   PUser post_replay_user=dbu.Q_user_info(dbu.Q_user_info_ofid(pos.post_reply_id));
%>
  <li>
<div id="replays" class="replays">

		<div id="photo">
    		<img width="48" height="48"src=	"<%=post_user.puser_face %>" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
  @<%=post_user.puser_name %> <%=pos. post_time%> <a href="Front-end/user/user_info_check.jsp">回复</a>
   </div> 
   
  <div class="content" id="content">
  <b><%=post_topic.topic_name%></b>
  <br>
  <br>
 <%=pos.post_content %>
  </div>
</div>
	</li>
  <%}} %>  
     <li>
<div id="replays" class="replays">

		<div id="photo">
    		<img width="48" height="48"src=	"assets/img/photo/photo_11.png" style="border-radius: 50%;overflow:hidden;"/>
		</div>

  <div id="topic_name">
 @root 2020-04-27 13:34 <a href="add_replay_post.jsp">回复</a>
  </div> 
   
  <div class="content" id="content">
  <b>测试主题1</b>
  <br>
  <br>
  @root 我回复我自己。
  </div>
</div>
	</li>
</ul>


<%} %>
</body>
</html>
